Revert r39949 "* Revert revert r39662 of my parser changes."
Causes weird regressions on http://meta.wikimedia.org/wiki/Talk:Spam_blacklist
Couldn't isolate to a parser test in a few minutes; some kind of template interaction perhaps.
Sample bad HTML like:
The associated page is used by the Mediawiki <a href="<a href=" class="external free" title="http://www.mediawiki.org/wiki/Extension:SpamBlacklist" rel="nofollow">http://www.mediawiki.org/wiki/Extension:SpamBlacklist</a>" class="extiw" title="mw:Extension:SpamBlacklist">Spam Blacklist extension, and lists strings of text that may not be used in URLs in any page in Wikimedia Foundation projects (as well as many external wikis). Any meta <a href="/wiki/Administrator" title="Administrator">administrator</a> can edit the spam blacklist. There is also a more aggressive way to block spamming through direct use of <a href="/wiki/Anti-spam_features#.24wgSpamRegex" title="Anti-spam features">$wgSpamRegex</a>. Only <a href="/wiki/Developers" title="Developers" class="mw-redirect">developers</a> can make changes to $wgSpamRegex, and its use is to be avoided whenever possible.